/************************************************************************

 Copyright (C), 2010-2021, Eight Rings Electron Co.,LTD.

 File name: hd.h

 Author: ptz
 Version: 0.01
 Date: 2011-06-15

 Description: display,rf
 Others:

 Function List:
 1: number_turn() value --> arrayTurn[]
 2: symbol_turn() symbol --> arrayTurn[]
 3: display_clear() arrayTurn[] --> clear
 4: display_out() arrayDisplay[] --> display
 5: display() arrayTurn[] --> arrayDisplay[]

 History:
 1. Date:
    Author:
    Version:
    Modification:

************************************************************************/

#ifndef _DISPLAY_H_
#define _DISPLAY_H_

/**********************************************************************

                            display

**********************************************************************/
#define rck_on PORTC|=0b00000010
#define rck_off PORTC&=0b11111101
#define sck_on PORTC|=0b00000100
#define sck_off PORTC&=0b11111011
#define si_on PORTC|=0x01
#define si_off PORTC&=0xfe

#define sizeOfChar 8
#define numberOfDisplay 4

#define led1_on PORTD&=0b01111111
#define led2_on PORTD&=0b10111111
#define led1_off PORTD|=0b10000000
#define led2_off PORTD|=0b01000000

#define table(num) pgm_read_byte(flashTable+(num))

#define point1_on arrayDisplay[0]|=0b10000000
#define point2_on arrayDisplay[1]|=0b10000000
#define point3_on arrayDisplay[2]|=0b10000000
#define point4_on arrayDisplay[3]|=0b10000000

#define symbolL 0x00
#define symbolH 0x01
#define symbolZero 0x02
#define symbolGas 0x03
#define symbolErr 0x04
#define symbolAddress 0x05
#define symbolCurrent4ma 0x06
#define symbolCurrent8ma 0x07
#define symbolCurrent12ma 0x08
#define symbolCurrent16ma 0x09
#define symbolCurrent20ma 0x0a
#define symbolA 0x0b
#define symbolNone 0x0c
#define symbolVer 0x0d


extern uint8_t displayImmediately;
extern uint8_t a;
extern void number_turn(uint16_t value, uint8_t point);
extern void symbol_turn(uint8_t symbol);
//extern void dis_led(void);
extern void display_clear(void);
extern void display_all(void);
extern void display(void);
//extern void key_dis(void);

#endif
